from enum import Enum
from typing import List, Optional


class AppReviewStatuesEnum(Enum):
    Review = ("待审核", 0)
    Pass = ("通过", 1)
    Refused = ("拒绝", 2)

    def __init__(self, text: str, value: int):
        self._text = text
        self._value = value

    @classmethod
    def get_values(cls) -> List[int]:
        return [item._value for item in cls]

    @classmethod
    def get_enum_by_value(cls, value: int) -> Optional['AppReviewStatuesEnum']:
        for item in cls:
            if item._value == value:
                return item
        return None

    def get_value(self) -> int:
        return self._value

    def get_text(self) -> str:
        return self._text